
local mt = ac.buff['变形']
mt.model = [[units\critters\Sheep\Sheep.mdl]]

mt.time = 5

mt.debuff = true

mt.control = true

function mt:on_cover()
    return true
end

function mt:on_add()
    local unit = self.owner
    self.defaultid = unit:get_id()
    self.default_model = unit:get_model()
    unit:add_restriction "缴械"
    unit:add_restriction "沉默"
    unit:set_model(self.model)
    unit:add_effect([[Abilities\Spells\Human\Polymorph\PolyMorphDoneGround.mdl]], 'origin'):remove()
    --unit:play_sound('变形术')
end

function mt:on_remove()
    local unit = self.owner
    unit:remove_restriction "缴械"
    unit:remove_restriction "沉默"
    unit:set_model(self.default_model)
    unit:add_effect([[Abilities\Spells\Human\Polymorph\PolyMorphDoneGround.mdl]], 'origin'):remove()
end
